<?php
/**
 * 首页
 *
 * @author   xg
 * @date     2019-09-12
 */

namespace app\statis\controller;

use app\base\controller\Backend;
use app\statis\model\UserModel;
use think\Db;
class Index extends Backend
{

    protected $noNeedLogin = [
        'statis/index/userstatis',
    ];

    /**
     * 默认方法
     */
    public function userStatis()
    {
        $BeginDate=date('Y-m-01', strtotime(date("Y-m-d")));
        echo $BeginDate;
        echo "<br/>";
        echo date('Y-m-d', strtotime("$BeginDate +1 month -1 day"));
        echo "<br/>";
        exit;
        // 开始时间戳
        $startUnix = 1563379200; // 2015-12-01 00:00:00
        // 结束的时间戳
        $endUnix = 1568736000; // 2015-12-15 00:00:00
        $sql = 'select user_source,user_id as user_count, FROM_UNIXTIME(user_create_time, \'%Y-%m-%d\') as datetime from jnd_user where user_create_time>= '.$startUnix.' and user_create_time <= '.$endUnix .' group by datetime';
        $a = DB::name('user')->query($sql);





        $this->success('成功', ['uid' => $this->user_id]);
    }



}